﻿namespace BM.Tools.WebControls.MForm.Design
{
    using System.Web.UI;
    using System.Web.UI.Design;

    using BM.Tools.WebControls.MForm.Controls;

    /// <summary>
    /// This is the <see cref="ControlDesigner" /> of the <see cref="OffspringsOwner" /> class when in the edit designer mode.
    /// </summary>
    public class OffspringsOwnerEditDesigner : SingleTemplateControlDesigner
    {
        /// <summary>
        /// Gets OffspringsOwner.
        /// </summary>
        public OffspringsOwner OffspringsOwner
        {
            get
            {
                return ViewControl as OffspringsOwner;
            }
        }

        /// <summary>
        /// Gets CurrentTemplate.
        /// </summary>
        protected override ITemplate CurrentTemplate
        {
            get
            {
                return OffspringsOwner.Contents;
            }
        }

        /// <summary>
        /// Gets TemplatePropertyName.
        /// </summary>
        protected override string TemplatePropertyName
        {
            get
            {
                return "Contents";
            }
        }

        /// <summary>
        /// Gets the header title for the content
        /// </summary>
        protected override string ContainerDesignTimeHtmlContentBeginning
        {
            get
            {
                return @"<tr><th style=""border: 1px solid black; text-align: left; padding: 1px;"">" + OffspringsOwner.GetType().Name + " - " + OffspringsOwner.DisplayName + "</th></tr>";
            }
        }
    }
}